feat: add support for L1 fee buffers in gas calculations for multiple coin families#8292
Draft
shubham-damkondwar wants to merge 1 commit intomasterfrom
Draft
feat: add support for L1 fee buffers in gas calculations for multiple coin families#8292shubham-damkondwar wants to merge 1 commit intomasterfrom
shubham-damkondwar wants to merge 1 commit intomasterfrom
Conversation
Contributor
Author
|
@claude please review |
cef744a to
a479e73
Compare
Contributor
Author
|
@claude please review |
a479e73 to
098f39e
Compare
There was a problem hiding this comment.
Pull request overview
Adds a generalized L1 data-fee buffer into ETH-like recovery gas calculations so additional L2 coin families can account for extra L1 fees during balance checks and sweep amount computation.
Changes:
- Renamed the gas config field to a generic
l1GasFeeBuffer. - Applied the L1 fee buffer for a configurable set of coin families (instead of only
opeth) in both base-coin and token recovery paths. - Ignored
.worktrees/in git.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| modules/statics/src/tokenConfig.ts | Renames the L1 fee buffer config to a generic key (l1GasFeeBuffer). |
| modules/abstract-eth/src/ethLikeToken.ts | Applies L1 fee buffer to token recovery gas-needed calculation for selected families. |
| modules/abstract-eth/src/abstractEthLikeNewCoins.ts | Introduces family allowlist and applies L1 fee buffer in recovery/balance validation flows. |
| .gitignore | Adds .worktrees/ to ignored paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin { | ||
| static hopTransactionSalt = 'bitgoHopAddressRequestSalt'; | ||
| protected readonly sendMethodName: 'sendMultiSig' | 'sendMultiSigToken'; | ||
| protected readonly coinFamiliesWithL1Fees: ReadonlyArray<string> = ['opeth', 'dogeos', 'morpheth']; |
Comment on lines
+1520
to
+1522
| // On L2 chains with L1 data fees, add buffer for L1 fees | ||
| if (this.staticsCoin?.family !== undefined && this.coinFamiliesWithL1Fees.includes(this.staticsCoin.family)) { | ||
| totalGasNeeded = totalGasNeeded.add(new optionalDeps.ethUtil.BN(ethGasConfigs.l1GasFeeBuffer)); |
Comment on lines
+1520
to
+1522
| // On L2 chains with L1 data fees, add buffer for L1 fees | ||
| if (this.staticsCoin?.family !== undefined && this.coinFamiliesWithL1Fees.includes(this.staticsCoin.family)) { | ||
| totalGasNeeded = totalGasNeeded.add(new optionalDeps.ethUtil.BN(ethGasConfigs.l1GasFeeBuffer)); |
Comment on lines
+279
to
+281
| // On L2 chains with L1 data fees, add buffer for L1 fees | ||
| if (this.staticsCoin?.family !== undefined && this.coinFamiliesWithL1Fees.includes(this.staticsCoin.family)) { | ||
| totalGasNeeded = totalGasNeeded.add(new optionalDeps.ethUtil.BN(ethGasConfigs.l1GasFeeBuffer)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TICKET: CECHO-354